<!DOCTYPE html>
<html lang="zh">
  <head>
    <meta charset="UTF-8" />
    <title>脱单盲盒</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1, maximum-scale=1"
    />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <link
    rel="stylesheet"
    title="default"
    href="https://cdn.jsdelivr.net/npm/amis@beta/sdk/sdk.css"
  />
   <link
    rel="stylesheet"
    href="https://cdn.jsdelivr.net/npm/amis@beta/sdk/helper.css"
  />    
    <script src="https://cdn.jsdelivr.net/npm/amis@beta/sdk/sdk.js"></script>
    <link rel="stylesheet" href="iconfont.css" />
    <!-- 这是默认主题所需的，如果是其他主题则不需要 -->
    <!-- 从 1.1.0 开始 sdk.css 将不支持 IE 11，如果要支持 IE11 请引用这个 css，并把前面那个删了 -->
    <!-- <link rel="stylesheet" href="sdk-ie11.css" /> -->
    <!-- 不过 amis 开发团队几乎没测试过 IE 11 下的效果，所以可能有细节功能用不了，如果发现请报 issue -->
    <style>
      html,
      body,
      .app-wrapper {
        position: relative;
        width: 100%;
        height: 100%;
        margin: 0;
        padding: 0;
      }
    </style>
  </head>
  <body>
    <div id="root" class="app-wrapper"></div>
    <script src="sdk.js"></script>
    <script type="text/javascript">
      (function () {
        let amis = amisRequire('amis/embed');
        // 通过替换下面这个配置来生成不同页面
        let amisJSON = {
    "type": "form",
    "title": "海大脱单表单",
    "body": [
        {
            "label": "姓名",
            "type": "input-text",
            "name": "name",
            "readOnly": false,
            "required": true,
            "placeholder": "需要填写真实姓名哦"
        },
        {
            "type": "radios",
            "label": "单选框",
            "name": "sex",
            "options": [
                {
                    "label": "男",
                    "value": 1
                },
                {
                    "label": "女",
                    "value": 0
                }
            ],
            "joinValues": true,
            "required": true
        },
        {
            "type": "checkboxes",
            "label": "性取向",
            "name": "sexto",
            "options": [
                {
                    "label": "男",
                    "value": "A"
                },
                {
                    "label": "女",
                    "value": "B"
                }
            ],
            "joinValues": true,
            "editable": false,
            "creatable": false
        },
        {
            "label": "QQ",
            "type": "input-text",
            "name": "qq",
            "required": true
        },
        {
            "label": "邮箱",
            "type": "input-text",
            "name": "email",
            "required": true,
            "description": "后续你的配对结果将会被发送到邮箱里面，请注意查看。",
            "validations": {
                "isEmail": true
            }
        },
        {
            "type": "select",
            "label": "年级",
            "name": "nianji",
            "options": [
                {
                    "label": "21",
                    "value": "21"
                },
                {
                    "label": "20",
                    "value": "20"
                },
                {
                    "label": "19",
                    "value": "19"
                },
                {
                    "label": "18",
                    "value": "18"
                }
            ],
            "required": true,
            "description": "会优先匹配同年级的学生哦",
            "checkAll": false,
            "selectFirst": true
        },
        {
            "type": "input-text",
            "label": "专业",
            "name": "zhuanye"
        },
        {
            "type": "list-select",
            "label": "你的特征",
            "name": "list1",
            "options": [
                {
                    "label": "电竞少女",
                    "value": "A"
                },
                {
                    "label": "热情辣妹",
                    "value": "B"
                },
                {
                    "label": "温柔甜妹",
                    "value": "C"
                },
                {
                    "label": "朋友圈达人",
                    "value": "D"
                },
                {
                    "label": "吃货爱好者",
                    "value": "E"
                },
                {
                    "label": "JK",
                    "value": "F"
                }
            ],
            "multiple": true,
            "joinValues": true,
            "visibleOn": "this.sex == 0",
            "required": false
        },
        {
            "type": "list-select",
            "label": "你的理想型",
            "name": "list2",
            "options": [
                {
                    "label": "电竞少女",
                    "value": "A"
                },
                {
                    "label": "热情辣妹",
                    "value": "B"
                },
                {
                    "label": "温柔甜妹",
                    "value": "C"
                },
                {
                    "label": "朋友圈达人",
                    "value": "D"
                },
                {
                    "label": "吃货爱好者",
                    "value": "E"
                },
                {
                    "label": "JK",
                    "value": "F"
                }
            ],
            "multiple": true,
            "joinValues": true,
            "visibleOn": "this.sex == 1"
        },
        {
            "type": "list-select",
            "label": "你的特征",
            "name": "list1",
            "options": [
                {
                    "label": "电竞达人",
                    "value": "A"
                },
                {
                    "label": "无话不谈",
                    "value": "B"
                },
                {
                    "label": "超级学霸",
                    "value": "C"
                },
                {
                    "label": "身高180",
                    "value": "D"
                },
                {
                    "label": "吃货爱好者",
                    "value": "E"
                },
                {
                    "label": "运动达人",
                    "value": "F"
                }
            ],
            "multiple": true,
            "joinValues": true,
            "visibleOn": "this.sex == 1",
            "description": "这两个数据将会尽可能地选取与对方差异值最小的一组。"
        },
        {
            "type": "list-select",
            "label": "你的理想型",
            "name": "list2",
            "options": [
                {
                    "label": "电竞达人",
                    "value": "A"
                },
                {
                    "label": "无话不谈",
                    "value": "B"
                },
                {
                    "label": "超级学霸",
                    "value": "C"
                },
                {
                    "label": "身高180人",
                    "value": "D"
                },
                {
                    "label": "吃货爱好者",
                    "value": "E"
                },
                {
                    "label": "运动达人",
                    "value": "F"
                }
            ],
            "multiple": true,
            "joinValues": true,
            "visibleOn": "this.sex == 0",
            "description": "这两个数据将会尽可能地选取与对方差异值最小的一组。",
            "remark": null
        },
        {
            "type": "textarea",
            "label": "想说些什么",
            "name": "textarea",
            "minRows": 0,
            "maxRows": 20,
            "required": false,
            "description": "这个信息虽然不会影响配对结果，但是同样是很重要的一部分哦，同样会呈现给对方。"
        },
        {
            "type": "input-image",
            "label": "图片上传",
            "name": "image",
            "imageClassName": "r w-full",
            "description": "会优先尽可能使得有图片上传的人配对哦"
        },
        {
            "type": "select",
            "label": "检验问题：海大有几个食堂",
            "name": "jioayan",
            "options": [
                {
                    "label": "4",
                    "value": "4"
                },
                {
                    "label": "5",
                    "value": "5"
                },
                {
                    "label": "6",
                    "value": "6"
                },
                {
                    "label": "7",
                    "value": "7"
                },
                {
                    "label": "8",
                    "value": "8"
                },
                {
                    "label": "9",
                    "value": "9"
                },
                {
                    "label": "10",
                    "value": "10"
                }
            ],
            "checkAll": false,
            "required": true,
            "validations": {
            },
            "validationErrors": {
            },
            "selectFirst": true
        }
    ]
};
        let amisScoped = amis.embed('#root', amisJSON);
      })();
    </script>
  </body>
</html>